package com.example.demo.entity;

import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;

import java.io.Serializable;
import java.util.Date;

/**
 * (User)实体类
 *
 * @author makejava
 * @since 2020-12-08 14:12:24
 */
public class User implements Serializable {

    private static final long serialVersionUID = -83470963589889123L;

    private Integer userId;

    private String userName;

    private String userPassword;

    private String userSex;

    private String userStuid;

    private String userPhone;

    private String userAcademy;

    private Date userStartdate;

    private Date userEnddate;

    private String userState;

    private Integer userBnum;

    private String userRemarks;

    private Date createTime;

    private Date updateTime;

    private String obj1;

    private String obj2;


    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserPassword() {
        return userPassword;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }

    public String getUserSex() {
        return userSex;
    }

    public void setUserSex(String userSex) {
        this.userSex = userSex;
    }

    public String getUserStuid() {
        return userStuid;
    }

    public void setUserStuid(String userStuid) {
        this.userStuid = userStuid;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getUserAcademy() {
        return userAcademy;
    }

    public void setUserAcademy(String userAcademy) {
        this.userAcademy = userAcademy;
    }

    public Date getUserStartdate() {
        return userStartdate;
    }

    public void setUserStartdate(Date userStartdate) {
        this.userStartdate = userStartdate;
    }

    public Date getUserEnddate() {
        return userEnddate;
    }

    public void setUserEnddate(Date userEnddate) {
        this.userEnddate = userEnddate;
    }

    public String getUserState() {
        return userState;
    }

    public void setUserState(String userState) {
        this.userState = userState;
    }

    public Integer getUserBnum() {
        return userBnum;
    }

    public void setUserBnum(Integer userBnum) {
        this.userBnum = userBnum;
    }

    public String getUserRemarks() {
        return userRemarks;
    }

    public void setUserRemarks(String userRemarks) {
        this.userRemarks = userRemarks;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getObj1() {
        return obj1;
    }

    public void setObj1(String obj1) {
        this.obj1 = obj1;
    }

    public String getObj2() {
        return obj2;
    }

    public void setObj2(String obj2) {
        this.obj2 = obj2;
    }
    public String getToken() {
        String token="";
        token= JWT.create().withAudience(this.getUserStuid()+"wwdlibsystem")
                .sign(Algorithm.HMAC256(this.getUserPassword()));
        return token;
    }
}